<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../vendor/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../vendor/bootstrap-icons/font/bootstrap-icons.css">
    <title>bs</title>

<body>

<div class="container p-2">
    <div class="row g-2">
        <div class="col-md-6">
            <div class="qtab1"></div>
            <button class="btn btn-success btn1 mt-2">添加tab</button>
        </div>
    </div>
</div>


<script src="../vendor/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="../vendor/jquery/dist/jquery.min.js"></script>
<script src="../vendor/bootstrap-quicktab/dist/js/bootstrap-quicktab.min.js"></script>

<script>
    $(function () {

        var qtab1 = new Quicktab({
            selector: '.qtab1',
        });

        $('.btn1').on('click', function () {
            var num = Math.round(Math.random() * (100000 - 1) + 1);
            qtab1.addTab({
                //标题
                title: "这一串title很长很长很长很长很长很长很长很长" + num,
                //连接
                url: 'welcome.html?randow=' + num,
                //是否可以关闭
                close: true,
            })
        })

    })


</script>

</body>
</html>
